-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TF-3385 Update UI by user actions before web socket #3390
TF-3385 Update UI by user actions before web socket #3390
Conversation
This PR has been deployed to https://linagora.github.io/tmail-flutter/3390. |
...eatures/mailbox_dashboard/presentation/extensions/update_current_emails_flags_extension.dart
Show resolved
Hide resolved
lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart
Outdated
Show resolved
Hide resolved
Screen.Recording.2025-01-02.at.11.16.36.mov |
Screen.Recording.2025-01-02.at.11.30.05.mov |
...eatures/mailbox_dashboard/presentation/extensions/update_current_emails_flags_extension.dart
Outdated
Show resolved
Hide resolved
lib/features/mailbox_dashboard/presentation/extensions/delete_emails_in_mailbox_extension.dart
Outdated
Show resolved
Hide resolved
should-show-loading-when-waiting-for-ws.movshould-show-loading-when-waiting-for-ws.in.trash.mov |
should.keep.flag.status.after.chaging.mailbox.mov |
mark.as.read.and.unread.work.mov |
move.and.undo.work.in.normal.mode.movmove.and.undo.work.in.search.mov |
read.star.move.in.search.work.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
** Note: Web socket disabled
- Mark as multiple email read not work
mark-as-multiple-email-read.mov
- Mark as star in Email View not work
mark-as-star-email-view.mov
- Mark as star/mark as read multiple email not work in search on mobile responsive web
mark-as-star-read-multiple-email-in-search-mobile-responsive.mov
- Auto back thread view when preview email in search view
auto-back-thread-view-when.back-preview-email.mov
return Future.wait(emailsCache.map((emailCache) => storeEmail( | ||
accountId, | ||
userName, | ||
emailCache, | ||
))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use Future.wait
let's use store multiple value to box of hive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
await mapDataSource[DataSourceType.local]!.markAsMailboxRead( | ||
session, | ||
accountId, | ||
mailboxId, | ||
totalEmailUnread - result.length, | ||
onProgressController, | ||
); | ||
await emailDataSource?.markAsRead( | ||
session, | ||
accountId, | ||
result, | ||
ReadActions.markAsRead, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do them simultaneously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Map<MailboxId, List<EmailId>> get emailIdsByMailboxId => Map.from( | ||
where((email) => email.mailboxContain?.mailboxId != null && email.id != null) | ||
.fold(<MailboxId, List<EmailId>>{}, (combine, email) { | ||
final mailboxId = email.mailboxContain!.mailboxId!; | ||
combine[mailboxId] ??= []; | ||
combine[mailboxId]!.add(email.id!); | ||
return combine; | ||
} | ||
), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Map<MailboxId, List<EmailId>> get emailIdsByMailboxId => Map.from( | |
where((email) => email.mailboxContain?.mailboxId != null && email.id != null) | |
.fold(<MailboxId, List<EmailId>>{}, (combine, email) { | |
final mailboxId = email.mailboxContain!.mailboxId!; | |
combine[mailboxId] ??= []; | |
combine[mailboxId]!.add(email.id!); | |
return combine; | |
} | |
), | |
); | |
Map<MailboxId, List<EmailId>> get emailIdsByMailboxId { | |
final Map<MailboxId, List<EmailId>> result = {}; | |
for (final email in this) { | |
final mailboxId = email.mailboxContain?.mailboxId; | |
final emailId = email.id; | |
if (mailboxId != null && emailId != null) { | |
(result[mailboxId] ??= []).add(emailId); | |
} | |
} | |
return result; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart
Outdated
Show resolved
Hide resolved
lib/features/mailbox_dashboard/presentation/extensions/move_emails_to_mailbox_extension.dart
Outdated
Show resolved
Hide resolved
_checkIfCurrentMailboxCanLoadMore(); | ||
} else if (reactionState is DeleteEmailPermanentlySuccess | ||
|| reactionState is DeleteMultipleEmailsPermanentlyAllSuccess | ||
|| reactionState is DeleteMultipleEmailsPermanentlyHasSomeEmailFailure | ||
) { | ||
WidgetsBinding.instance.addPostFrameCallback((_) { | ||
_checkIfCurrentMailboxCanLoadMore(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there a place for WidgetsBinding.instance.addPostFrameCallback
when there isn't one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
final currentMailbox = mailboxDashBoardController.selectedMailbox.value; | ||
if (currentMailbox == null) return; | ||
|
||
final totalEmailsCount = currentMailbox.totalEmails?.value.value ?? 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use currentMailbox .countTotalEmails
function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Please check again. No code update needed. I can't reproduce it. Mark.as.read.by.select.all.mov |
Screen.Recording.2025-01-03.at.17.02.20.mov |
Mark.read.and.star.mobile.search.mov |
Not a bug from this PR. Reproducible on |
Issue
Implement details
crossedChanges
MailboxController
CreateDefaultMailboxAllSuccessSearchEmailController
UnsubscribeEmailSuccessStoreEventAttendanceStatusSuccessSearchMailboxController
ThreadController
SaveEmailAsDraftsSuccess || UpdateEmailDraftsSuccess || RemoveEmailDraftsSuccessSendEmailSuccessUnsubscribeEmailSuccessStoreEventAttendanceStatusSuccess